package com.lfy.util;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@ApiModel("返回类")
@Data
public class CommonResult<T> {
    @ApiModelProperty("消息")
    private String msg;
    @ApiModelProperty("吗")
    private Integer code;
    @ApiModelProperty("数据")
    private T date;

    public CommonResult(String msg, Integer code, T date) {
        this.msg = msg;
        this.code = code;
        this.date = date;
    }

    public static <T>CommonResult<T> success(T date){
        return new CommonResult<T>("1",1,date);
    }

}
